#@front_layout()
	
#define css()
	
#end

#define page()
<div class="page">
	<header class="bar bar-nav">
		 <a class="icon icon-me pull-left open-panel"></a>
	    <a class="icon icon-refresh pull-right"></a>
	    <h1 class="title">自测</h1>
	</header>
	<div class="content">
		
	</div>
</div>
#end

#define js()
<script>

var pageType = '#(pageType)';

function alertWordNum() {
	NB.prompt("你要生成多少组单词", '<input type="text" class="prompt-input" id="wordNum">', function() {
			var wordNum = $("#wordNum").val();
			if(isNaN(wordNum)) {
				NB.alert("请填写数字");
				alertWordNum();
			} else if(wordNum < 0) {
				NB.alert("请填写大于0的数");
				alertWordNum();
			} else {
				alertWordDeep(wordNum);
			}
		}, function() {
			window.location.href = ctx + "/checkView";
		});
}
function alertWordDeep(wordNum) {
	NB.prompt("你要生成哪些记忆深度", '<input type="text" placeholder="1-4，英文逗号分隔" class="prompt-input" id="wordDeep">', function() {
			window.location.href = ctx + "/" + pageType + "/" + wordNum + "-" + $("#wordDeep").val();
		}, function() {
			window.location.href = ctx + "/checkView";
		});
}

$(function() {
	alertWordNum();
});
</script>
#end